Skip to content

feat(input): implement libvirtualhid - #5368

Draft
ReenigneArcher wants to merge 1 commit into
masterfrom
libvirtualhid
Draft

feat(input): implement libvirtualhid#5368
ReenigneArcher wants to merge 1 commit into
masterfrom
libvirtualhid

Conversation

@ReenigneArcher

@ReenigneArcher ReenigneArcher commented Jul 3, 2026

Copy link
Copy Markdown
Member

Description

This PR implements libvirtualhid in Sunshine, replacing inputtino on Linux, vigembus on Windows AMD64, and moves the mouse/keyboard input for macOS as well.

We will still falling back to vigembus on Windows ARM64 or in cases where the user doesn't have libvirtualhid's driver installed.

TODO:

  • CI/CD passing
  • Sonar
  • Ensure we cover changes in the following PRs:
  • Test coverage
  • Testing
    • Windows
      • Gamepads
      • Keyboard
      • Mouse
      • Touchscreen
      • Pen
      • Trackpad (not supported on Windows)
    • Linux
      • Gamepads
      • Keyboard
      • Mouse
      • Touchscreen
      • Pen
      • Trackpad
    • FreeBSD
      • Gamepads
      • Keyboard
      • Mouse
      • Touchscreen
      • Pen
      • Trackpad
    • macOS
      • Gamepads (not supported on macOS currently)
      • Keyboard
      • Mouse
      • Touchscreen (not supported on macOS)
      • Pen (not supported on macOS)
      • Trackpad (not supported on macOS)
  • Remove vigembus helpers from web-ui
  • Create release of libvirtualhid
  • Publish libvirtualhid driver to MSFT store

Known issues:

  • Xbox Series gamepad on Windows - missing "Share/Misc" button
  • DS4/DS5/Nintendo Switch Pro gamepads - rumble does not work

Screenshot

image

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@ReenigneArcher ReenigneArcher changed the title feat: implement libvirtualhid feat(input): implement libvirtualhid Jul 3, 2026
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 4.76kB (0.19%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sunshine-esm 867.22kB 4.76kB (0.55%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/logo-*.js 1.76kB 382.54kB 0.46%
assets/config-*.js 924 bytes 73.1kB 1.28%
assets/index-*.js 388 bytes 47.2kB 0.83%
assets/troubleshooting-*.js 2.1kB 11.15kB 23.26% ⚠️
assets/download-*.js (Deleted) -414 bytes 0 bytes -100.0% 🗑️

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.26510% with 652 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@3cba9ba). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/virtualhid_input.cpp 30.42% 372 Missing and 51 partials ⚠️
src/confighttp.cpp 43.55% 73 Missing and 54 partials ⚠️
src/platform/windows/input.cpp 10.66% 57 Missing and 10 partials ⚠️
src/platform/linux/input/virtualhid.cpp 53.84% 14 Missing and 4 partials ⚠️
src/platform/macos/input.cpp 54.54% 10 Missing ⚠️
src/input.cpp 0.00% 4 Missing and 1 partial ⚠️
src/config.cpp 0.00% 0 Missing and 1 partial ⚠️
src/platform/virtualhid_input.h 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5368   +/-   ##
=========================================
  Coverage          ?   28.76%           
=========================================
  Files             ?      104           
  Lines             ?    24452           
  Branches          ?    10941           
=========================================
  Hits              ?     7033           
  Misses            ?    14222           
  Partials          ?     3197           
Flag Coverage Δ
Archlinux 0.00% <0.00%> (?)
FreeBSD-amd64 13.68% <15.13%> (?)
Homebrew-macos-14 22.12% <18.64%> (?)
Homebrew-macos-15 22.75% <18.64%> (?)
Homebrew-macos-26 22.86% <18.64%> (?)
Homebrew-ubuntu-24.04 14.71% <22.60%> (?)
Linux-AppImage 14.13% <22.60%> (?)
Windows-AMD64 18.08% <17.34%> (?)
Windows-ARM64 15.46% <13.55%> (?)
macOS-arm64 19.26% <16.07%> (?)
macOS-x86_64 19.93% <16.07%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/config.h 0.00% <ø> (ø)
src/confighttp.h 100.00% <ø> (ø)
src/platform/common.h 34.37% <100.00%> (ø)
src/config.cpp 24.26% <0.00%> (ø)
src/platform/virtualhid_input.h 0.00% <0.00%> (ø)
src/input.cpp 18.02% <0.00%> (ø)
src/platform/macos/input.cpp 59.25% <54.54%> (ø)
src/platform/linux/input/virtualhid.cpp 53.84% <53.84%> (ø)
src/platform/windows/input.cpp 5.43% <10.66%> (ø)
src/confighttp.cpp 45.43% <43.55%> (ø)
... and 1 more

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3cba9ba...0af629e. Read the comment docs.

Comment thread src/confighttp.cpp Fixed
Comment thread tests/unit/test_confighttp.cpp Fixed
Comment thread tests/unit/test_confighttp.cpp Fixed
@ReenigneArcher
ReenigneArcher force-pushed the libvirtualhid branch 7 times, most recently from a3e7ed7 to fe08cf1 Compare July 15, 2026 12:30
@ReenigneArcher
ReenigneArcher force-pushed the libvirtualhid branch 16 times, most recently from c0b07b1 to 19ba419 Compare July 21, 2026 17:17
Comment thread .github/workflows/ci-linux.yml Fixed
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Last Updated 2026-08-10 21:07:58 UTC
Source Run CI Run #4923
Commit 0af629e0aa3b970c329b8676bb5d50916474f84d

Screenshot Comparison

PR #5368 screenshots vs screenshots baseline.

Matrix: AppImage

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-AMD64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-ARM64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

@ReenigneArcher
ReenigneArcher force-pushed the libvirtualhid branch 5 times, most recently from 04853b6 to beab94f Compare August 10, 2026 19:43
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment